/*
 * @Date: 2022-11-08 13:25:17
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-11-24 10:24:40
 * @FilePath: \vue-admin-ts\src\apis\login\login.ts
 * @Description: login相关接口
 */
import request from "@/utils/request";
import type { ILoginRes, IUserInfoData } from "./type";
import { IDataType } from "@/apis/type";
export const loginByAccount = (data: { name: string; password: string }) => {
  return request.post<IDataType<ILoginRes>>({
    url: "/login",
    data,
  });
};

export const reqUserInfoById = (id: number) => {
  return request.get<IDataType<IUserInfoData>>({
    url: `/users/${id}`,
  });
};

export const reqUserMenusByRoleId = (id: number) => {
  return request.get<IDataType>({
    url: `/role/${id}/menu`,
  });
};
